<template>
  <div class="ThresholdSetting">
    <div class="left">
      <div class="left-operation">
        <el-form size="mini" ref="form" label-width="80px">
          <el-form-item size="mini" label>
            <el-input size="mini" class="yd-input" v-model="queryStr" maxlength="15"></el-input>
          </el-form-item>
          <el-button class="but-query" type="text" size="medium" @click="handleQuery">
            <i class="query-icon"></i>查询
          </el-button>
          <el-button class="but-reset" type="text" size="medium" @click="handleQueryReset">
            <i class="reset-icon"></i>重置
          </el-button>
        </el-form>
      </div>
      <div class="tree-list">
        <Tree-List
          ref="TreeList"
          :data="allDeviceTreeList"
          :showIcon="true"
          :showState="true"
          @vtl_nodeClick="handleTreeNodeClick"
          @vtl_nodeLabelClick="handleTreeNodeClick"
          :activedDisabled="true"
        ></Tree-List>
      </div>
    </div>
    <div class="right">
      <div class="right-operation">
        <el-form size="mini" ref="form" label-width="80px">
          <el-form-item size="mini" label="设备名称:">
            <el-input size="mini" class="yd-input" readonly v-model="deviceName" maxlength="15"></el-input>
          </el-form-item>
          <el-form-item label="识别类型:">
            <el-input
              size="mini"
              class="yd-input"
              readonly
              v-model="recognitionType"
              maxlength="15"
            ></el-input>
          </el-form-item>
          <el-button class="but-save" type="text" size="medium" @click="handleSave">
            <i class="save-icon"></i>保存
          </el-button>
          <el-button class="but-reset" type="text" size="medium" @click="handleReset(null)">
            <i class="reset-icon"></i>重置
          </el-button>
        </el-form>
      </div>
      <div
        class="card-item"
        v-if="currentTreeNode.reconTypeId !== 0 && currentTreeNode.reconTypeId === 5"
      >
        <div class="card-operation">
          <el-form size="mini" ref="form" label-width="auto">
            <el-row>
              <el-col>
                <span class="card-title">超温报警</span>
                <el-form-item size="mini" label="是否使能:">
                  <el-select
                    size="mini"
                    v-model="overtemperatureAlarm.isEffective"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in effectiveList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="限值显示样式:">
                  <el-select
                    size="mini"
                    v-model="overtemperatureAlarm.valueType"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in valueTypeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="致热类型:">
                  <el-input size="mini" readonly placeholder v-model="hotType" maxlength="15"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row style="background-color: #eeeeee;">
              <el-col>
                <el-button
                  class="but-add"
                  type="text"
                  size="medium"
                  @click="handleAdd(overtemperatureAlarm.alarmTypeId)"
                >
                  <i class="add-icon"></i>新增
                </el-button>
                <el-button
                  class="but-remove"
                  type="text"
                  size="medium"
                  @click="handleRemove(overtemperatureAlarm.alarmTypeId)"
                >
                  <i class="remove-icon"></i>删除
                </el-button>
                <el-button
                  class="but-reset"
                  type="text"
                  size="medium"
                  @click="handleReset(overtemperatureAlarm.alarmTypeId)"
                >
                  <i class="reset-icon"></i>重置
                </el-button>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="content-list">
          <el-table
            ref="overtemperatureAlarm"
            :data="overtemperatureAlarm.List"
            border
            highlight-current-row
            size="mini"
            class="el-table-redefine"
            style="width: 100%"
            height="100%"
            @current-change="handleCurrentChange"
            :row-class-name="tableRowClassName"
          >
            <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
            <el-table-column prop="alarmName" label="报警名称">
              <template slot-scope="scope">
                <el-input size="mini" placeholder v-model="scope.row.alarmName" maxlength="15"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="limitValue" label="数值">
              <template slot-scope="scope">
                <el-input
                  size="mini"
                  placeholder
                  v-model="scope.row.limitValue"
                  oninput="value=value.replace(/[^0-9.]/g,'')"
                  maxlength="15"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="upOrDown" label="类型">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.upOrDown" placeholder>
                  <el-option
                    v-for="item in upOrDownList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column prop="alarmLevel" label="告警等级">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.alarmLevel" placeholder>
                  <el-option
                    v-for="item in alarmLevelList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <!--  -->
      <div
        class="card-item"
        v-if="currentTreeNode.reconTypeId !== 0 && currentTreeNode.reconTypeId === 5"
      >
        <div class="card-operation">
          <el-form size="mini" ref="form" label-width="auto">
            <el-row>
              <el-col>
                <span class="card-title">温升报警</span>
                <el-form-item size="mini" label="是否使能:">
                  <el-select
                    size="mini"
                    v-model="TemperatureRiseAlarm.isEffective"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in effectiveList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="限值显示样式:">
                  <el-select
                    size="mini"
                    v-model="TemperatureRiseAlarm.valueType"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in valueTypeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="温度参考值:">
                  <el-input
                    size="mini"
                    v-model="TemperatureRiseAlarm.referenceTemp"
                    oninput="value=value.replace(/[^0-9.]/g,'')"
                    maxlength="15"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row style="background-color: #eeeeee;">
              <el-col>
                <el-button
                  class="but-add"
                  type="text"
                  size="medium"
                  @click="handleAdd(TemperatureRiseAlarm.alarmTypeId)"
                >
                  <i class="add-icon"></i>新增
                </el-button>
                <el-button
                  class="but-remove"
                  type="text"
                  size="medium"
                  @click="handleRemove(TemperatureRiseAlarm.alarmTypeId)"
                >
                  <i class="remove-icon"></i>删除
                </el-button>
                <el-button
                  class="but-reset"
                  type="text"
                  size="medium"
                  @click="handleReset(TemperatureRiseAlarm.alarmTypeId)"
                >
                  <i class="reset-icon"></i>重置
                </el-button>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="content-list">
          <el-table
            ref="TemperatureRiseAlarm"
            :data="TemperatureRiseAlarm.List"
            border
            highlight-current-row
            size="mini"
            class="el-table-redefine"
            style="width: 100%"
            height="100%"
            @current-change="handleCurrentChange"
          >
            <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
            <el-table-column prop="alarmName" label="报警名称">
              <template slot-scope="scope">
                <el-input size="mini" placeholder v-model="scope.row.alarmName" maxlength="15"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="limitValue" label="数值">
              <template slot-scope="scope">
                <el-input
                  size="mini"
                  placeholder
                  v-model="scope.row.limitValue"
                  oninput="value=value.replace(/[^0-9.]/g,'')"
                  maxlength="15"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="upOrDown" label="类型">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.upOrDown" placeholder>
                  <el-option
                    v-for="item in upOrDownList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column prop="alarmLevel" label="告警等级">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.alarmLevel" placeholder>
                  <el-option
                    v-for="item in alarmLevelList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <!--  -->
      <div
        class="card-item"
        v-if="currentTreeNode.reconTypeId !== 0 && currentTreeNode.reconTypeId === 5"
      >
        <div class="card-operation">
          <el-form size="mini" ref="form" label-width="auto">
            <el-row>
              <el-col>
                <span style="width: 130px;" class="card-title">三相对比报警</span>
                <el-form-item size="mini" label="是否使能:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="threephaseCompareAlarm.isEffective"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in effectiveList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="限值显示样式:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="threephaseCompareAlarm.valueType"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in valueTypeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item size="mini" label="启用环境温度:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="threephaseCompareAlarm.isOpenEnvironmentTemp"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in openEnvironmentTempList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>-->
                <!-- <el-form-item label="单相最低温度:">
                  <el-input size="mini" class="yd-input"></el-input>
                </el-form-item>-->
                <!-- <el-form-item label="单相最低温升:">
                  <el-input size="mini" class="yd-input"></el-input>
                </el-form-item>-->
              </el-col>
            </el-row>
            <el-row style="background-color: #eeeeee;">
              <el-col>
                <el-button
                  class="but-add"
                  type="text"
                  size="medium"
                  @click="handleAdd(threephaseCompareAlarm.alarmTypeId)"
                >
                  <i class="add-icon"></i>新增
                </el-button>
                <el-button
                  class="but-remove"
                  type="text"
                  size="medium"
                  @click="handleRemove(threephaseCompareAlarm.alarmTypeId)"
                >
                  <i class="remove-icon"></i>删除
                </el-button>
                <el-button
                  class="but-reset"
                  type="text"
                  size="medium"
                  @click="handleReset(threephaseCompareAlarm.alarmTypeId)"
                >
                  <i class="reset-icon"></i>重置
                </el-button>
                <el-button
                  class="but-binding"
                  type="text"
                  size="medium"
                  @click="handleBinding(threephaseCompareAlarm.alarmTypeId)"
                >
                  <i class="binding-icon"></i>绑定
                </el-button>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="content-list">
          <el-table
            ref="threephaseCompareAlarm"
            :data="threephaseCompareAlarm.List"
            border
            highlight-current-row
            size="mini"
            class="el-table-redefine"
            style="width: 100%"
            height="100%"
            @current-change="handleCurrentChange"
          >
            <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
            <el-table-column prop="alarmName" label="报警名称">
              <template slot-scope="scope">
                <el-input size="mini" placeholder v-model="scope.row.alarmName" maxlength="15"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="limitValue" label="数值">
              <template slot-scope="scope">
                <el-input
                  size="mini"
                  placeholder
                  v-model="scope.row.limitValue"
                  oninput="value=value.replace(/[^0-9.]/g,'')"
                  maxlength="15"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="upOrDown" label="类型">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.upOrDown" placeholder>
                  <el-option
                    v-for="item in upOrDownList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column prop="alarmLevel" label="告警等级">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.alarmLevel" placeholder>
                  <el-option
                    v-for="item in alarmLevelList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <!--  -->
      <div
        class="card-item"
        v-if="currentTreeNode.reconTypeId !== 0 && currentTreeNode.reconTypeId === 5"
      >
        <div class="card-operation">
          <el-form size="mini" ref="form" label-width="auto">
            <el-row>
              <el-col>
                <span style="width: 130px;" class="card-title">三相温差报警</span>
                <el-form-item size="mini" label="是否使能:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="TemperatureRiseCompareAlarm.isEffective"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in effectiveList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="限值显示样式:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="TemperatureRiseCompareAlarm.valueType"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in valueTypeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item size="mini" label="启用环境温度:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="TemperatureRiseCompareAlarm.isOpenEnvironmentTemp"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in openEnvironmentTempList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>-->
                <!-- <el-form-item size="mini" label="温度参考值:">
                  <el-input
                    size="mini"
                    class="yd-input"
                    v-model="TemperatureRiseCompareAlarm.referenceTemp"
                  ></el-input>
                </el-form-item>-->
                <!-- <el-form-item size="mini" label-width="110px" label="设备温度参考体:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="TemperatureRiseCompareAlarm.referenceBody"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in device_T_List"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>-->
              </el-col>
            </el-row>
            <el-row style="background-color: #eeeeee;">
              <el-col>
                <el-button
                  class="but-add"
                  type="text"
                  size="medium"
                  @click="handleAdd(TemperatureRiseCompareAlarm.alarmTypeId)"
                >
                  <i class="add-icon"></i>新增
                </el-button>
                <el-button
                  class="but-remove"
                  type="text"
                  size="medium"
                  @click="handleRemove(TemperatureRiseCompareAlarm.alarmTypeId)"
                >
                  <i class="remove-icon"></i>删除
                </el-button>
                <el-button
                  class="but-reset"
                  type="text"
                  size="medium"
                  @click="handleReset(TemperatureRiseCompareAlarm.alarmTypeId)"
                >
                  <i class="reset-icon"></i>重置
                </el-button>
                <el-button
                  class="but-binding"
                  type="text"
                  size="medium"
                  @click="handleBinding(TemperatureRiseCompareAlarm.alarmTypeId)"
                >
                  <i class="binding-icon"></i>绑定
                </el-button>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="content-list">
          <el-table
            ref="TemperatureRiseCompareAlarm"
            :data="TemperatureRiseCompareAlarm.List"
            border
            highlight-current-row
            size="mini"
            class="el-table-redefine"
            style="width: 100%"
            height="100%"
            @current-change="handleCurrentChange"
          >
            <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
            <el-table-column prop="alarmName" label="报警名称">
              <template slot-scope="scope">
                <el-input size="mini" placeholder v-model="scope.row.alarmName" maxlength="15"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="limitValue" label="数值">
              <template slot-scope="scope">
                <el-input
                  size="mini"
                  placeholder
                  v-model="scope.row.limitValue"
                  oninput="value=value.replace(/[^0-9.]/g,'')"
                  maxlength="15"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="upOrDown" label="类型">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.upOrDown" placeholder>
                  <el-option
                    v-for="item in upOrDownList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column prop="alarmLevel" label="告警等级">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.alarmLevel" placeholder>
                  <el-option
                    v-for="item in alarmLevelList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <!--  -->
      <div
        class="card-item"
        v-if="currentTreeNode.reconTypeId !== 0 && currentTreeNode.reconTypeId !== 5"
      >
        <div class="card-operation">
          <el-form size="mini" ref="form" label-width="auto">
            <el-row>
              <el-col>
                <span style="width: 130px;" class="card-title">越限报警</span>
                <el-form-item size="mini" label="是否使能:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="CrossingTheLineAlarm.isEffective"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in effectiveList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item size="mini" label="限值显示样式:">
                  <el-select
                    size="mini"
                    style="width: 120px;"
                    v-model="CrossingTheLineAlarm.valueType"
                    clearable
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in valueTypeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row style="background-color: #eeeeee;">
              <el-col>
                <el-button
                  class="but-add"
                  type="text"
                  size="medium"
                  @click="handleAdd(CrossingTheLineAlarm.alarmTypeId)"
                >
                  <i class="add-icon"></i>新增
                </el-button>
                <el-button
                  class="but-remove"
                  type="text"
                  size="medium"
                  @click="handleRemove(CrossingTheLineAlarm.alarmTypeId)"
                >
                  <i class="remove-icon"></i>删除
                </el-button>
                <el-button
                  class="but-reset"
                  type="text"
                  size="medium"
                  @click="handleReset(CrossingTheLineAlarm.alarmTypeId)"
                >
                  <i class="reset-icon"></i>重置
                </el-button>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="content-list">
          <el-table
            ref="CrossingTheLineAlarm"
            :data="CrossingTheLineAlarm.List"
            border
            highlight-current-row
            size="mini"
            class="el-table-redefine"
            style="width: 100%"
            height="100%"
            @current-change="handleCurrentChange"
          >
            <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
            <el-table-column prop="alarmName" label="报警名称">
              <template slot-scope="scope">
                <el-input size="mini" placeholder v-model="scope.row.alarmName" maxlength="15"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="limitValue" label="数值">
              <template slot-scope="scope">
                <el-input
                  size="mini"
                  placeholder
                  v-model="scope.row.limitValue"
                  oninput="value=value.replace(/[^0-9.]/g,'')"
                  maxlength="15"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="upOrDown" label="类型">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.upOrDown" placeholder>
                  <el-option
                    v-for="item in upOrDownList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column prop="alarmLevel" label="告警等级">
              <template slot-scope="scope">
                <el-select size="mini" v-model="scope.row.alarmLevel" placeholder>
                  <el-option
                    v-for="item in alarmLevelList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
    <Points-Relationship
      ref="PointsRelationship"
      :data="currentTreeNode"
      :pointListData="intervalPointList"
      v-on:listenToChildEvent="showMsgFromChild"
    ></Points-Relationship>
  </div>
</template>
<script>
import {
  reconTypesList,
  hotTypesList,
  pointsTree,
  pointAlarmSettingsList,
  pointAlarmSettingsBatch,
  robotParams,
  postOperationLogs
} from "@/api/apiManagement";

import PointsRelationship from "./components/PointsRelationship";
import TreeList from "@/components/TreeList";

export default {
  components: { PointsRelationship, TreeList },
  data() {
    return {
      robot_id: null,
      substationName: "",
      recognitionTypeList: [],
      hotTypesList: [],
      deviceName: "",
      recognitionType: "",
      hotType: "",
      queryStr: "",
      allDeviceTreeList: [],
      currentTreeNode: {
        reconTypeId: 0
      },
      intervalPointList: [],
      effectiveList: [
        {
          value: 0,
          label: "否"
        },
        {
          value: 1,
          label: "是"
        }
      ],
      valueTypeList: [
        {
          value: 1,
          label: "数值"
        },
        {
          value: 2,
          label: "百分百"
        }
      ],
      openEnvironmentTempList: [
        {
          value: 0,
          label: "否"
        },
        {
          value: 1,
          label: "是"
        }
      ],
      referenceBodyList: [],
      upOrDownList: [
        {
          value: 0,
          label: "下限"
        },
        {
          value: 1,
          label: "上限"
        }
      ],
      alarmLevelList: [
        {
          value: 0,
          label: "正常"
        },
        {
          value: 1,
          label: "预告"
        },
        {
          value: 2,
          label: "一般告警"
        },
        {
          value: 3,
          label: "严重告警"
        },
        {
          value: 4,
          label: "危急告警"
        }
      ],
      device_T_List: [],
      pointAlarmQuery: {
        page: 1,
        size: 0,
        pointId: 0,
        alarmTypeId: null
      },
      pointAlarmInfo: {
        name: ""
      },
      alarmList: [],
      overtemperatureAlarm: {
        alarmTypeId: 1,
        isEffective: 1,
        isOpenEnvironmentTemp: 0,
        referenceTemp: 0,
        referenceBody: null,
        valueType: 1,
        List: []
      },
      TemperatureRiseAlarm: {
        alarmTypeId: 2,
        isEffective: 1,
        isOpenEnvironmentTemp: 0,
        referenceTemp: 0,
        referenceBody: null,
        valueType: 1,
        List: []
      },
      threephaseCompareAlarm: {
        alarmTypeId: 3,
        isEffective: 1,
        isOpenEnvironmentTemp: 0,
        referenceTemp: 0,
        referenceBody: null,
        valueType: 1,
        List: []
      },
      TemperatureRiseCompareAlarm: {
        alarmTypeId: 4,
        isEffective: 1,
        isOpenEnvironmentTemp: 0,
        referenceTemp: 0,
        referenceBody: null,
        valueType: 1,
        List: []
      },
      CrossingTheLineAlarm: {
        alarmTypeId: 5,
        isEffective: 1,
        isOpenEnvironmentTemp: 0,
        referenceTemp: 0,
        referenceBody: null,
        valueType: 1,
        List: []
      },
      rosObj: {
        ip: "",
        port: ""
      }
    };
  },
  created() {
    this.robot_id = localStorage.getItem("ydRobot_id");
    //
    this.getRobotParams({
      page: 1,
      size: 0,
      robotId: this.robot_id,
      type: 3
    });
    // 识别类型
    this.getReconTypesList();
    // 发热类型
    this.getHotTypesList();
    // // 巡检类型默认配置
    // this.getInspectTypeChoosesDefaultChecks();
    // 点位树
    this.getPointsTree();
  },
  mounted() {},
  methods: {
    deepRecursionTraversal(node) {
      node.map(item => {
        if (item.children) {
          this.deepRecursionTraversal(item.children);
        } else {
          if (item.points) {
            // item.children = item.points;
            item.points = item.points.map(item => {
              item.id = "point_" + item.id;
              item.leaf = true;
              return item;
            });
            this.deepRecursionTraversal(item.points);
          } else {
            //
          }
        }
        return item;
      });
      return node;
    },

    // 识别类型
    getReconTypesList() {
      reconTypesList()
        .then(response => {
          if (response.list) {
            this.recognitionTypeList = response.list;
          }
        })
        .catch(() => {});
    },
    // 发热类型
    getHotTypesList() {
      hotTypesList()
        .then(response => {
          if (response.list) {
            this.hotTypesList = response.list;
          }
        })
        .catch(() => {});
    },
    //
    // handleNodeClick(data) {
    handleTreeNodeClick(tree, treeList, treeObj, data) {
      if (data.leaf) {
        this.deviceName = "";
        this.recognitionType = "";
        this.hotType = "";

        this.deviceName = data.name;
        if (this.recognitionTypeList.length > 0) {
          for (var i = 0, len = this.recognitionTypeList.length; i < len; i++) {
            if (this.recognitionTypeList[i].id === data.reconTypeId) {
              this.recognitionType = this.recognitionTypeList[i].name;
            }
          }
        }
        if (this.hotTypesList.length > 0) {
          for (var i = 0, len = this.hotTypesList.length; i < len; i++) {
            if (this.hotTypesList[i].id === data.hotTypeId) {
              this.hotType = this.hotTypesList[i].name;
            }
          }
        }
        if (data.id.toString().indexOf("point_") != -1) {
          this.currentTreeNode = data;
          this.pointAlarmInfo.name = data.name;
          this.pointAlarmQuery.pointId = data.id.substring(6, data.id.length);
          this.pointAlarmQuery.alarmTypeId = null;
          delete this.pointAlarmQuery.alarmTypeId;
          this.getPointAlarmSettingsList();
        }
      }
    },

    handleQuery() {
      this.$refs.TreeList.vtl_nodesSearch({ str: this.queryStr });
    },
    handleQueryReset() {
      this.queryStr = "";
      this.$refs.TreeList.vtl_nodesSearch({ str: this.queryStr });
    },

    getAlarmLevelClassName(value) {
      if (value === 0) {
        return "normal";
      }
      if (value === 1) {
        return "warning";
      }
      if (value === 2) {
        return "general-alarm";
      }
      if (value === 3) {
        return "serious-alarm";
      }
      if (value === 4) {
        return "danger-alarm";
      }
    },
    // 巡检类型默认配置
    getInspectTypeChoosesDefaultChecks() {
      inspectTypeChoosesDefaultChecks({
        inspectId: this.filterForm.inspectionType
      }).then(response => {
        if (response) {
          for (var i = 0, len = response.length; i < len; i++) {
            if (response[i].inspectTypeId === this.filterForm.inspectionType) {
              if (response[i].chooseType === 0) {
                //
              }
              if (response[i].chooseType === 1) {
                //
              }
              if (response[i].chooseType === 2) {
                //
              }
              if (response[i].chooseType === 3) {
                //
              }
              if (response[i].chooseType === 4) {
                //
              }
            }
          }
        }
        this.getPointsTree();
      });
    },
    // 点位树
    getPointsTree() {
      pointsTree()
        .then(response => {
          if (response) {
            this.allDeviceTreeList = response;
          }
        })
        .catch(() => {});
    },
    getPointAlarmSettingsList() {
      pointAlarmSettingsList(this.pointAlarmQuery)
        .then(response => {
          if (response.list) {
            this.alarmList = [];
            if (
              this.pointAlarmQuery.alarmTypeId == undefined ||
              this.pointAlarmQuery.alarmTypeId == "undefined" ||
              this.pointAlarmQuery.alarmTypeId == null ||
              this.pointAlarmQuery.alarmTypeId === 0
            ) {
              this.overtemperatureAlarm.List = [];
              this.TemperatureRiseAlarm.List = [];
              this.threephaseCompareAlarm.List = [];
              this.TemperatureRiseCompareAlarm.List = [];
              this.CrossingTheLineAlarm.List = [];
            }
            if (this.pointAlarmQuery.alarmTypeId === 1) {
              this.overtemperatureAlarm.List = [];
            }
            if (this.pointAlarmQuery.alarmTypeId === 2) {
              this.TemperatureRiseAlarm.List = [];
            }
            if (this.pointAlarmQuery.alarmTypeId === 3) {
              this.threephaseCompareAlarm.List = [];
            }
            if (this.pointAlarmQuery.alarmTypeId === 4) {
              this.TemperatureRiseCompareAlarm.List = [];
            }
            if (this.pointAlarmQuery.alarmTypeId === 5) {
              this.CrossingTheLineAlarm.List = [];
            }
            //
            for (var i = 0, len = response.list.length; i < len; i++) {
              if (response.list[i].alarmTypeId === 1) {
                this.overtemperatureAlarm.alarmTypeId =
                  response.list[i].alarmTypeId;
                this.overtemperatureAlarm.alarmType =
                  response.list[i].alarmType;
                this.overtemperatureAlarm.isEffective =
                  response.list[i].isEffective;
                this.overtemperatureAlarm.isOpenEnvironmentTemp =
                  response.list[i].isOpenEnvironmentTemp;
                this.overtemperatureAlarm.referenceTemp =
                  response.list[i].referenceTemp;
                this.overtemperatureAlarm.referenceBody =
                  response.list[i].referenceBody;
                this.overtemperatureAlarm.valueType =
                  response.list[i].valueType;
                this.overtemperatureAlarm.List.push({
                  id: response.list[i].id,
                  alarmName: response.list[i].alarmName,
                  limitValue: response.list[i].limitValue,
                  upOrDown: response.list[i].upOrDown,
                  alarmLevel: response.list[i].alarmLevel
                });
              }
              if (response.list[i].alarmTypeId === 2) {
                this.TemperatureRiseAlarm.alarmTypeId =
                  response.list[i].alarmTypeId;
                this.TemperatureRiseAlarm.alarmType =
                  response.list[i].alarmType;
                this.TemperatureRiseAlarm.isEffective =
                  response.list[i].isEffective;
                this.TemperatureRiseAlarm.isOpenEnvironmentTemp =
                  response.list[i].isOpenEnvironmentTemp;
                this.TemperatureRiseAlarm.referenceTemp =
                  response.list[i].referenceTemp;
                this.TemperatureRiseAlarm.referenceBody =
                  response.list[i].referenceBody;
                this.TemperatureRiseAlarm.valueType =
                  response.list[i].valueType;
                this.TemperatureRiseAlarm.List.push({
                  id: response.list[i].id,
                  alarmName: response.list[i].alarmName,
                  limitValue: response.list[i].limitValue,
                  upOrDown: response.list[i].upOrDown,
                  alarmLevel: response.list[i].alarmLevel
                });
              }
              if (response.list[i].alarmTypeId === 3) {
                this.threephaseCompareAlarm.alarmTypeId =
                  response.list[i].alarmTypeId;
                this.threephaseCompareAlarm.alarmType =
                  response.list[i].alarmType;
                this.threephaseCompareAlarm.isEffective =
                  response.list[i].isEffective;
                this.threephaseCompareAlarm.isOpenEnvironmentTemp =
                  response.list[i].isOpenEnvironmentTemp;
                this.threephaseCompareAlarm.referenceTemp =
                  response.list[i].referenceTemp;
                this.threephaseCompareAlarm.referenceBody =
                  response.list[i].referenceBody;
                this.threephaseCompareAlarm.valueType =
                  response.list[i].valueType;
                this.threephaseCompareAlarm.List.push({
                  id: response.list[i].id,
                  alarmName: response.list[i].alarmName,
                  limitValue: response.list[i].limitValue,
                  upOrDown: response.list[i].upOrDown,
                  alarmLevel: response.list[i].alarmLevel
                });
              }
              if (response.list[i].alarmTypeId === 4) {
                this.TemperatureRiseCompareAlarm.alarmTypeId =
                  response.list[i].alarmTypeId;
                this.TemperatureRiseCompareAlarm.alarmType =
                  response.list[i].alarmType;
                this.TemperatureRiseCompareAlarm.isEffective =
                  response.list[i].isEffective;
                this.TemperatureRiseCompareAlarm.isOpenEnvironmentTemp =
                  response.list[i].isOpenEnvironmentTemp;
                this.TemperatureRiseCompareAlarm.referenceTemp =
                  response.list[i].referenceTemp;
                this.TemperatureRiseCompareAlarm.referenceBody =
                  response.list[i].referenceBody;
                this.TemperatureRiseCompareAlarm.valueType =
                  response.list[i].valueType;
                this.TemperatureRiseCompareAlarm.List.push({
                  id: response.list[i].id,
                  alarmName: response.list[i].alarmName,
                  limitValue: response.list[i].limitValue,
                  upOrDown: response.list[i].upOrDown,
                  alarmLevel: response.list[i].alarmLevel
                });
              }
              if (response.list[i].alarmTypeId === 5) {
                this.CrossingTheLineAlarm.alarmTypeId =
                  response.list[i].alarmTypeId;
                this.CrossingTheLineAlarm.alarmType =
                  response.list[i].alarmType;
                this.CrossingTheLineAlarm.isEffective =
                  response.list[i].isEffective;
                this.CrossingTheLineAlarm.isOpenEnvironmentTemp =
                  response.list[i].isOpenEnvironmentTemp;
                this.CrossingTheLineAlarm.referenceTemp =
                  response.list[i].referenceTemp;
                this.CrossingTheLineAlarm.referenceBody =
                  response.list[i].referenceBody;
                this.CrossingTheLineAlarm.valueType =
                  response.list[i].valueType;
                this.CrossingTheLineAlarm.List.push({
                  id: response.list[i].id,
                  alarmName: response.list[i].alarmName,
                  limitValue: response.list[i].limitValue,
                  upOrDown: response.list[i].upOrDown,
                  alarmLevel: response.list[i].alarmLevel
                });
              }
              //
              if (
                this.alarmList.some(
                  it => it.alarmTypeId === response.list[i].alarmTypeId
                )
              ) {
                this.alarmList = this.alarmList.map(it => {
                  if (it.alarmTypeId === response.list[i].alarmTypeId) {
                    it.List.push({
                      id: response.list[i].id,
                      alarmName: response.list[i].alarmName,
                      limitValue: response.list[i].limitValue,
                      upOrDown: response.list[i].upOrDown,
                      alarmLevel: response.list[i].alarmLevel
                    });
                  }
                  return it;
                });
              } else {
                this.alarmList.push({
                  alarmTypeId: response.list[i].alarmTypeId,
                  alarmType: response.list[i].alarmType,
                  isEffective: response.list[i].isEffective,
                  isOpenEnvironmentTemp: response.list[i].isOpenEnvironmentTemp,
                  referenceTemp: response.list[i].referenceTemp,
                  referenceBody: response.list[i].referenceBody,
                  valueType: response.list[i].valueType,
                  List: [
                    {
                      id: response.list[i].id,
                      alarmName: response.list[i].alarmName,
                      limitValue: response.list[i].limitValue,
                      upOrDown: response.list[i].upOrDown,
                      alarmLevel: response.list[i].alarmLevel
                    }
                  ]
                });
              }
            }
          }
        })
        .catch(() => {});
    },
    handleSave() {
      if (
        this.currentTreeNode.reconTypeId === 0 ||
        this.pointAlarmQuery.pointId === 0
      ) {
        this.$message({
          message: "请选择设备点位",
          type: "success"
        });
      } else {
        var tempList = [];
        if (this.currentTreeNode.reconTypeId === 5) {
          if (
            this.overtemperatureAlarm.List &&
            this.overtemperatureAlarm.List.length > 0
          ) {
            tempList = this.overtemperatureAlarm.List.map(item => {
              return {
                alarmLevel: item.alarmLevel,
                alarmName: item.alarmName,
                alarmTypeId: this.overtemperatureAlarm.alarmTypeId,
                isEffective: this.overtemperatureAlarm.isEffective,
                isOpenEnvironmentTemp: this.overtemperatureAlarm
                  .isOpenEnvironmentTemp,
                limitValue: item.limitValue,
                referenceTemp: this.overtemperatureAlarm.referenceTemp,
                upOrDown: item.upOrDown,
                valueType: this.overtemperatureAlarm.valueType
              };
            }).concat(tempList);
          }
          if (
            this.TemperatureRiseAlarm.List &&
            this.TemperatureRiseAlarm.List.length > 0
          ) {
            tempList = this.TemperatureRiseAlarm.List.map(item => {
              return {
                alarmLevel: item.alarmLevel,
                alarmName: item.alarmName,
                alarmTypeId: this.TemperatureRiseAlarm.alarmTypeId,
                isEffective: this.TemperatureRiseAlarm.isEffective,
                isOpenEnvironmentTemp: this.TemperatureRiseAlarm
                  .isOpenEnvironmentTemp,
                limitValue: item.limitValue,
                referenceTemp: this.TemperatureRiseAlarm.referenceTemp,
                upOrDown: item.upOrDown,
                valueType: this.TemperatureRiseAlarm.valueType
              };
            }).concat(tempList);
          }
          if (
            this.threephaseCompareAlarm.List &&
            this.threephaseCompareAlarm.List.length > 0
          ) {
            tempList = this.threephaseCompareAlarm.List.map(item => {
              return {
                alarmLevel: item.alarmLevel,
                alarmName: item.alarmName,
                alarmTypeId: this.threephaseCompareAlarm.alarmTypeId,
                isEffective: this.threephaseCompareAlarm.isEffective,
                isOpenEnvironmentTemp: this.threephaseCompareAlarm
                  .isOpenEnvironmentTemp,
                limitValue: item.limitValue,
                referenceTemp: this.threephaseCompareAlarm.referenceTemp,
                upOrDown: item.upOrDown,
                valueType: this.threephaseCompareAlarm.valueType
              };
            }).concat(tempList);
          }
          if (
            this.TemperatureRiseCompareAlarm.List &&
            this.TemperatureRiseCompareAlarm.List.length > 0
          ) {
            tempList = this.TemperatureRiseCompareAlarm.List.map(item => {
              return {
                alarmLevel: item.alarmLevel,
                alarmName: item.alarmName,
                alarmTypeId: this.TemperatureRiseCompareAlarm.alarmTypeId,
                isEffective: this.TemperatureRiseCompareAlarm.isEffective,
                isOpenEnvironmentTemp: this.TemperatureRiseCompareAlarm
                  .isOpenEnvironmentTemp,
                limitValue: item.limitValue,
                referenceTemp: this.TemperatureRiseCompareAlarm.referenceTemp,
                upOrDown: item.upOrDown,
                valueType: this.TemperatureRiseCompareAlarm.valueType
              };
            }).concat(tempList);
          }
        }
        if (this.currentTreeNode.reconTypeId !== 5) {
          if (
            this.CrossingTheLineAlarm.List &&
            this.CrossingTheLineAlarm.List.length > 0
          ) {
            tempList = this.CrossingTheLineAlarm.List.map(item => {
              return {
                alarmLevel: item.alarmLevel,
                alarmName: item.alarmName,
                alarmTypeId: this.CrossingTheLineAlarm.alarmTypeId,
                isEffective: this.CrossingTheLineAlarm.isEffective,
                isOpenEnvironmentTemp: this.CrossingTheLineAlarm
                  .isOpenEnvironmentTemp,
                limitValue: item.limitValue,
                referenceTemp: this.CrossingTheLineAlarm.referenceTemp,
                upOrDown: item.upOrDown,
                valueType: this.CrossingTheLineAlarm.valueType
              };
            }).concat(tempList);
          }
        }
        pointAlarmSettingsBatch({
          pointId: this.pointAlarmQuery.pointId,
          pointAlarmSettingRequests: tempList
        }).then(response => {
          this.setOperationLogs(
            "配置-" + this.pointAlarmInfo.name + "-告警阈值设置"
          );
          this.dbTableUpdatePub({
            table_id: 1
          });
          this.pointAlarmQuery.alarmTypeId = null;
          delete this.pointAlarmQuery.alarmTypeId;
          this.getPointAlarmSettingsList();
          var messageStr = "";
          if (this.currentTreeNode.reconTypeId === 5) {
            messageStr =
              "<div>超温报警模块阀值保存成功!</div> <div>温升报警模块阀值保存成功!</div> <div>三相对比报警模块阀值保存成功!</div> <div>三相温差报警模块阀值保存成功!</div>";
          }
          if (this.currentTreeNode.reconTypeId !== 5) {
            messageStr = "<div>超限报警模块阀值保存成功!</div>";
          }
          this.$alert(messageStr, "提示", {
            dangerouslyUseHTMLString: true,
            confirmButtonText: "确定",
            callback: action => {}
          });
        });
      }
    },
    handleAdd(alarmTypeId) {
      if (
        this.currentTreeNode.reconTypeId === 0 ||
        this.pointAlarmQuery.pointId === 0
      ) {
        this.$message({
          message: "请选择设备点位",
          type: "success"
        });
      } else {
        if (alarmTypeId === 1) {
          this.overtemperatureAlarm.List.push({
            alarmName: "",
            limitValue: 0,
            upOrDown: 1,
            alarmLevel: 1
          });
        }
        if (alarmTypeId === 2) {
          this.TemperatureRiseAlarm.List.push({
            alarmName: "",
            limitValue: 0,
            upOrDown: 1,
            alarmLevel: 1
          });
        }
        if (alarmTypeId === 3) {
          this.threephaseCompareAlarm.List.push({
            alarmName: "",
            limitValue: 0,
            upOrDown: 1,
            alarmLevel: 1
          });
        }
        if (alarmTypeId === 4) {
          this.TemperatureRiseCompareAlarm.List.push({
            alarmName: "",
            limitValue: 0,
            upOrDown: 1,
            alarmLevel: 1
          });
        }
        if (alarmTypeId === 5) {
          this.CrossingTheLineAlarm.List.push({
            alarmName: "",
            limitValue: 0,
            upOrDown: 1,
            alarmLevel: 1
          });
        }
      }
    },
    handleRemove(alarmTypeId) {
      if (
        this.currentTreeNode.reconTypeId === 0 ||
        this.pointAlarmQuery.pointId === 0
      ) {
        this.$message({
          message: "请选择设备点位",
          type: "success"
        });
      } else {
        if (alarmTypeId === 1) {
          if (this.$refs.overtemperatureAlarm.store.states.currentRow) {
            this.overtemperatureAlarm.List.splice(
              this.$refs.overtemperatureAlarm.store.states.currentRow.nIndex,
              1
            );
          }
        }
        if (alarmTypeId === 2) {
          if (this.$refs.TemperatureRiseAlarm.store.states.currentRow) {
            this.TemperatureRiseAlarm.List.splice(
              this.$refs.TemperatureRiseAlarm.store.states.currentRow.nIndex,
              1
            );
          }
        }
        if (alarmTypeId === 3) {
          if (this.$refs.threephaseCompareAlarm.store.states.currentRow) {
            this.threephaseCompareAlarm.List.splice(
              this.$refs.threephaseCompareAlarm.store.states.currentRow.nIndex,
              1
            );
          }
        }
        if (alarmTypeId === 4) {
          if (this.$refs.TemperatureRiseCompareAlarm.store.states.currentRow) {
            this.TemperatureRiseCompareAlarm.List.splice(
              this.$refs.TemperatureRiseCompareAlarm.store.states.currentRow
                .nIndex,
              1
            );
          }
        }
        if (alarmTypeId === 5) {
          if (this.$refs.CrossingTheLineAlarm.store.states.currentRow) {
            this.CrossingTheLineAlarm.List.splice(
              this.$refs.CrossingTheLineAlarm.store.states.currentRow.nIndex,
              1
            );
          }
        }
      }
    },
    handleReset(alarmTypeId) {
      if (
        this.currentTreeNode.reconTypeId === 0 ||
        this.pointAlarmQuery.pointId === 0
      ) {
        this.$message({
          message: "请选择设备点位",
          type: "success"
        });
      } else {
        this.pointAlarmQuery.alarmTypeId = alarmTypeId;
        if (alarmTypeId === null) {
          delete this.pointAlarmQuery.alarmTypeId;
        }
        this.getPointAlarmSettingsList();
      }
    },
    handleBinding(alarmTypeId) {
      if (
        this.currentTreeNode.reconTypeId === 0 ||
        this.pointAlarmQuery.pointId === 0
      ) {
        this.$message({
          message: "请选择设备点位",
          type: "success"
        });
      } else {
        this.intervalPointList = [];
        let rev = item => {
          var resultItem = {};
          let parentNode = this.$refs.TreeList.vtl_getNode({
            id: item.parentId
          });
          if (parentNode.modelLevel === 1100) {
            resultItem = parentNode;
          } else if (parentNode.modelLevel === 1010) {
            resultItem = null;
          } else {
            resultItem = rev(parentNode);
          }
          return resultItem;
        };
        var checkInterval = rev(this.currentTreeNode);
        let temp = JSON.parse(JSON.stringify(this.$refs.TreeList.vtl_getParentNodeLeafNodes(checkInterval)))
        this.intervalPointList = temp.map(item => {
          if (typeof item.id === "string" && item.id.indexOf("point_") != -1) {
            let index = item.id.lastIndexOf("_");
            let slice = item.id.substring(index + 1);
            item.id = parseInt(slice);
            return item;
          }
        });

        this.$refs.PointsRelationship.isShowDia(true, false, alarmTypeId);
      }
    },
    handleCurrentChange(currentRow, oldCurrentRow) {
      // console.log(currentRow);
      // console.log(oldCurrentRow);
    },
    tableRowClassName({ row, rowIndex }) {
      // 把每一行的索引放进row
      row.nIndex = rowIndex;
      return "";
    },
    showMsgFromChild(data) {
      //
    },
    getRobotParams(data) {
      robotParams(data)
        .then(response => {
          if (response.list && response.list.length > 0) {
            for (var i = 0, len = response.list.length; i < len; i++) {
              if (response.list[i].name === "ros_websocket_ip") {
                this.rosObj.ip = response.list[i].value;
              }
              if (response.list[i].name === "ros_websocket_port") {
                this.rosObj.port = response.list[i].value;
              }
            }
          }
        })
        .catch(() => {});
    },
    // 添加日志管理
    setOperationLogs(content) {
      var parm = {
        content: content,
        deviceId: localStorage.getItem("ydRobot_device_id"),
        type: 0
      };
      postOperationLogs(parm)
        .then(response => {})
        .catch(() => {});
    }
  }
};
</script>

<style>
.clearfix:after {
  content: "";
  display: block;
  height: 0;
  visibility: hidden;
  clear: both;
}
.clearfix {
  *zoom: 1;
}

.ThresholdSetting {
  width: 100%;
  height: 100%;
  min-width: 1530px;
  /* min-height: 1000px; */
}
.ThresholdSetting .left {
  position: relative;
  width: 300px;
  height: 100%;
  /* background-color: #eeeeee; */
  background-color: #fff;
  border-right: 1px solid rgb(202, 231, 238);
  float: left;
}
.ThresholdSetting .right {
  /* width: 100%; */
  width: calc(100% - 300px);
  height: 100%;
  background-color: #ffffff;
  border-left: 1px solid rgb(202, 231, 238);
  overflow: auto;
  float: right;
}
.ThresholdSetting .left-operation {
  width: 100%;
  height: 27px;
  padding: 0 2px;
  line-height: 27px;
  font-size: 13px;
  background: linear-gradient(
    rgb(227, 242, 238),
    rgb(202, 231, 238)
  ); /* 标准的语法 */
}
.ThresholdSetting .right-operation {
  width: 100%;
  height: 27px;
  padding: 0 5px;
  line-height: 27px;
  font-size: 13px;
  background: linear-gradient(
    rgb(227, 242, 238),
    rgb(202, 231, 238)
  ); /* 标准的语法 */
}
.ThresholdSetting .left .custom-tree-node span {
  font-size: 13px;
}
.ThresholdSetting .left-operation .yd-input {
  width: 170px;
  height: 27px;
  float: left;
}
.ThresholdSetting .left-operation .yd-input .el-input__inner {
  height: 27px;
  line-height: 25px;
  padding: 0 6px;
  border: 1px solid rgb(202, 231, 238);
}
.ThresholdSetting .left-operation .el-form-item {
  /* width: 300px; */
  width: auto;
  margin-top: 0;
  margin-bottom: 0;
  float: left;
}
.ThresholdSetting .left-operation .el-form-item__label {
  line-height: 26px;
  float: left;
}
.ThresholdSetting .left-operation .el-date-editor.el-input {
  width: 200px;
}
.ThresholdSetting .left-operation .el-form-item__content {
  /* width: 200px; */
  margin-left: 5px !important;
  line-height: 26px;
  float: left;
}
.ThresholdSetting .tree-list {
  position: absolute;
  width: 100%;
  height: calc(100% - 27px);
  overflow: auto;
}

.ThresholdSetting .right-operation .el-form-item {
  /* width: 300px; */
  width: auto;
  margin-top: 0;
  margin-bottom: 0;
  float: left;
}
.ThresholdSetting .right-operation .el-form-item__label {
  line-height: 26px;
  float: left;
}
.ThresholdSetting .right-operation .el-date-editor.el-input {
  width: 200px;
}
.ThresholdSetting .right-operation .el-form-item__content {
  /* width: 200px; */
  margin-left: 5px !important;
  line-height: 26px;
  float: left;
}
.ThresholdSetting .right-operation .yd-input {
  width: 260px;
  height: 27px;
  /* float: left; */
}
.ThresholdSetting .right-operation .yd-input .el-input__inner {
  height: 27px;
  line-height: 25px;
  padding: 0 6px;
  border: 1px solid rgb(202, 231, 238);
}
.ThresholdSetting .left-operation .but-query,
.ThresholdSetting .left-operation .but-reset {
  height: 27px;
  margin-left: 6px;
  margin-right: 3px;
  padding: 0;
  font-size: 13px;
  color: #000;
  float: left;
}
.ThresholdSetting .left-operation .query-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-image: url(../../../static/resources/images/query.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .left-operation .reset-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-image: url(../../../static/resources/images/reset_a.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .right-operation .but-save,
.ThresholdSetting .right-operation .but-reset {
  height: 27px;
  margin-left: 20px;
  margin-right: 10px;
  padding: 0;
  font-size: 13px;
  color: #000;
  float: left;
}
.ThresholdSetting .right-operation .save-icon {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  background-image: url(../../../static/resources/images/save.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .right-operation .reset-icon {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  background-image: url(../../../static/resources/images/reset_a.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .folder {
  width: 13px;
  height: 13px;
  margin-top: 3px;
  /* background-color: rgb(10, 158, 80); */
  background-image: url(../../../static/resources/images/folder.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .file {
  width: 13px;
  height: 13px;
  margin-top: 3px;
  /* background-color: rgb(255, 0, 0); */
  background-image: url(../../../static/resources/images/file.png);
  background-size: 100% 100%;
  float: left;
}

.ThresholdSetting .alarm {
  width: 12px;
  height: 13px;
  margin: 3px 2px 0 2px;
  float: left;
}
.ThresholdSetting .normal {
  background-color: rgb(50, 150, 50);
}
.ThresholdSetting .warning {
  background-color: rgb(0, 0, 255);
}
.ThresholdSetting .general-alarm {
  background-color: rgb(255, 255, 0);
}
.ThresholdSetting .serious-alarm {
  background-color: rgb(255, 128, 10);
}
.ThresholdSetting .danger-alarm {
  background-color: rgb(155, 0, 0);
}
.ThresholdSetting .card-item {
  position: relative;
  width: 100%;
  height: 230px;
  margin-bottom: 10px;
  background-color: #eeeeee;
  border: 1px solid rgb(191, 248, 200);
}
.ThresholdSetting .card-operation {
  width: 100%;
  height: 56px;
  /* padding: 0 5px; */
  line-height: 27px;
  font-size: 13px;
  background: linear-gradient(
    rgb(227, 242, 238),
    rgb(202, 231, 238)
  ); /* 标准的语法  */
}
.ThresholdSetting .card-operation .card-title {
  width: 100px;
  height: 27px;
  padding-left: 10px;
  line-height: 27px;
  font-size: 15px;
  text-align: left;
  color: rgb(72, 158, 2);
  float: left;
}
.ThresholdSetting .card-operation .el-input__inner {
  height: 25px;
  line-height: 23px;
  padding: 0 6px;
  border: 1px solid rgb(202, 231, 238);
}
.ThresholdSetting .card-operation .yd-input {
  width: 80px;
  height: 27px;
  /* float: left; */
}
.ThresholdSetting .card-operation .yd-input .el-input__inner {
  height: 25px;
  line-height: 23px;
  padding: 0 6px;
  border: 1px solid rgb(202, 231, 238);
}
.ThresholdSetting .card-operation .el-form-item {
  /* width: 300px; */
  width: auto;
  margin-top: 0;
  margin-bottom: 0;
  margin-right: 10px;
  float: left;
}
.ThresholdSetting .card-operation .el-form-item__label {
  line-height: 26px;
  padding: 0 0 0 0;
  float: left;
}
.ThresholdSetting .card-operation .el-date-editor.el-input {
  width: 200px;
}
.ThresholdSetting .card-operation .el-form-item__content {
  /* width: 200px; */
  margin-left: 0px !important;
  line-height: 26px;
  float: left;
}
.ThresholdSetting .card-operation .but-add,
.ThresholdSetting .card-operation .but-remove,
.ThresholdSetting .card-operation .but-reset,
.ThresholdSetting .card-operation .but-binding {
  height: 27px;
  margin-left: 10px;
  margin-right: 10px;
  padding: 0;
  font-size: 13px;
  color: #000;
  float: left;
}
.ThresholdSetting .card-operation .add-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-image: url(../../../static/resources/images/query.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .card-operation .remove-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-image: url(../../../static/resources/images/remove.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .card-operation .reset-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-image: url(../../../static/resources/images/reset_a.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .card-operation .binding-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-image: url(../../../static/resources/images/binding.png);
  background-size: 100% 100%;
  float: left;
}
.ThresholdSetting .content-list {
  position: absolute;
  width: 100%;
  height: calc(100% - 56px);
  /* overflow: auto; */
}

.ThresholdSetting .pagination-area {
  position: absolute;
  width: 100%;
  height: 32px;
  bottom: 0px;
  background-color: #eeeeee;
}
.ThresholdSetting .el-table-redefine {
  width: 100%;
  height: 100%;
  /* display: flex;
  flex-flow: column; */
}

.ThresholdSetting .el-table-redefine .el-table__body-wrapper {
  /* overflow: hidden;
  overflow-y: auto;
  flex-grow: 1; */
}
</style>